﻿using UnityEngine;

namespace GameCore
{
    public partial class LuaBehaviour : MonoBehaviour
    {
        [System.Serializable]
        public class ObjectWrap
        {
            public int index;
            public string name;
            public UnityEngine.Object obj;
            public string typeName;
            public string assembly;
        }
        
        private class ObjWrap<T> : IObjWrap
        {
            private T Obj;

            public object GetObj()
            {
                if (Obj == null)
                {
                    if(typeof(T) == typeof(string))
                        return "";
                    return default;
                }
                return Obj;
            }

            public void SetObj(object obj)
            {
                this.Obj = (T)obj;
            }
        }
    }
}
